package edu.whu.xterm.util;

public class StringUtils {

	public static final boolean isBlank(String string) {
		if (string == null || string.length() == 0) {
			return true;
		}
		final int l = string.length();
		for (int i = 0; i < l; i++) {
			if (!isWhiespace(string.codePointAt(i))) {
				return false;
			}
		}
		return true;
	}

	public static boolean isWhiespace(int c) {
		return c == ' ' || c == 160 || c == '\t' || c == '\n' || c == '\f' || c == '\r';
	}
}
